package com.gexiaobao.pigeon.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.BobInfoResponse
import com.gexiaobao.pigeon.app.model.bean.LoftMemberResponse
import com.gexiaobao.pigeon.databinding.ItemMemberListBinding
import com.gexiaobao.pigeon.databinding.ItemShedListBinding

/**
 * @Author      : hxw
 * @Date        : 2024/4/29 13:27
 * @Describe    :
 */
class MemberListAdapter(data: ArrayList<LoftMemberResponse.ListData>) :
    BaseQuickAdapter<LoftMemberResponse.ListData, DataBindBaseViewHolder>(R.layout.item_member_list, data) {
    override fun convert(holder: DataBindBaseViewHolder, item: LoftMemberResponse.ListData) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemMemberListBinding
        binding.data = item
        binding.executePendingBindings()

        if (holder.layoutPosition == data.size - 1) {
            holder.setGone(R.id.viewLineMember, true)
        } else {
            holder.setGone(R.id.viewLineMember, false)
        }
    }
}